<form action="{:sysuri()}" autocomplete="off" class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">订单用户</label>
        <label class="layui-input-inline">
            <input class="layui-input" name="user_keys" placeholder="请输入手机或昵称" value="{$get.user_keys|default=''}">
        </label>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">订单单号</label>
        <label class="layui-input-inline">
            <input class="layui-input" name="order_no" placeholder="请输入订单单号" value="{$get.order_no|default=''}">
        </label>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">付款状态</label>
        <label class="layui-input-inline">
            <select class="layui-select" name="payment_status">
                <option value=''>-- 全部 --</option>
                {foreach ['0'=>'待支付','1'=>'已支付'] as $k=>$v}
                {if input('payment_status') eq $k.''}
                <option selected value="{$k}">{$v}</option>
                {else}
                <option value="{$k}">{$v}</option>
                {/if}{/foreach}
            </select>
        </label>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">下单时间</label>
        <label class="layui-input-inline">
            <input class="layui-input" data-date-range name="create_at" placeholder="请选择下单时间" value="{$get.create_at|default=''}">
        </label>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">支付时间</label>
        <label class="layui-input-inline">
            <input class="layui-input" data-date-range name="payment_datetime" placeholder="请选择支付时间" value="{$get.payment_datetime|default=''}">
        </label>
    </div>

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary" type="submit"><i class="layui-icon">&#xe615;</i> 搜 索</button>
        <button class="layui-btn layui-btn-primary" data-form-export="{:url('index')}?type={$type|default=''}" type="button">
            <i class="layui-icon layui-icon-export"></i> 导 出
        </button>
    </div>
</form>

<script>
    require(['excel'], function (excel) {
        excel.bind(function (data) {
            var items = [];
            items.push(['订单号', '委托人姓名', '联系电话', '公证处', '业务类型', '证书份数', '支付状态', '支付金额', '支付时间']);
            data.forEach(function (order) {
                items.push([
                    order.order_no,
                    order.client_name,
                    order.client_phone,
                    order.notarial_office_name,
                    order.type_text,
                    order.number_goods,
                    order.payment_status ? '已支付' : '未支付',
                    order.amount_real || '0.00',
                    order.payment_datetime || '',
                ]);
            });
            return items;
        }, '用户订单记录');
    });
</script>